<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* html {
            font-size: 100px;
        } */
      
        * {
            margin: 0;
            padding: 0;
        }
        /* 当宽度小于等于319px时 html里的字体是40px*.5rem=20px */
        @media screen and (max-width:319px) {
            html {
                font-size:40px;;
            }
        }
          /* 从小到大的顺序 */
        /* 当宽度大于等于320px时 html里的字体是50px*.5rem=25px */

        @media screen and (min-width:320px) {
            html {
                font-size: 50px;
            }
        }
        /* 当宽度小于等于640px时 html里的字体是100px*.5rem=50px */

        @media screen and (min-width:640px) {
            html {
                font-size: 100px;
            }
        }
        .top {
            height: 1rem;
            background-color: green;
            font-size: .5rem;
            color: #fff;
            text-align: center;
            line-height: 1rem;
        }
    </style>
</head>
<body>
    <div class="top">
购物车
    </div>
</body>
</html>